package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Author WEN
 * @Date 2023/8/9 0009
 **/
@Data
@Accessors(chain = true)
@ApiModel("用户对象")
public class UserVo {

    @ApiModelProperty(value = "用户ID，新增不必传，修改必传")
    private Long id;

    @NotBlank(message = "用户名称不能为空")
    @Length(max = 100, message = "用户名称限制100个字符以内")
    @ApiModelProperty(value = "用户名称", required = true)
    private String name;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "手机格式不正确")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    @Length(max = 60, message = "用户编码限制60个字符以内")
    @ApiModelProperty(value = "用户编码")
    private String code;

    @NotNull(message = "用户状态不能为空")
    @NumberPattern(regexp = "^(0|1|2)$", message = "用户状态不合法！")
    @ApiModelProperty(value = "用户状态：0-正常，1-冻结，2-禁用", required = true, example = "0")
    private Integer status;

    @ApiModelProperty(value = "用户级别ID")
    private Long levelId;

    @Length(max = 20, message = "客户级别限制20个字符以内")
    @ApiModelProperty(value = "客户级别")
    private String level;

    @ApiModelProperty(value = "用户分类ID")
    private Long userTypeId;

    @Length(max = 20, message = "用户分类名称限制20个字符以内")
    @ApiModelProperty(value = "用户分类名称")
    private String userType;

    @Length(max = 200, message = "邮箱限制200个字符以内")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @NotBlank(message = "地址-省不能为空")
    @Length(max = 50, message = "地址-省限制50个字符以内")
    @ApiModelProperty(value = "地址-省", required = true)
    private String province;

    @NotBlank(message = "地址-市不能为空")
    @Length(max = 50, message = "地址-市限制50个字符以内")
    @ApiModelProperty(value = "地址-市", required = true)
    private String city;

    @NotBlank(message = "地址-县/区不能为空")
    @Length(max = 50, message = "地址-县/区限制50个字符以内")
    @ApiModelProperty(value = "地址-县/区", required = true)
    private String area;

    @Length(max = 50, message = "地址-镇限制50个字符以内")
    @ApiModelProperty(value = "地址-镇")
    private String town;

    @NotBlank(message = "地址-详细地址不能为空")
    @Length(max = 200, message = "地址-详细地址限制200个字符以内")
    @ApiModelProperty(value = "地址-详细地址", required = true)
    private String address;



}
